package com.wsoft.bpm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wsoft.bpm.entity.ActAddSignEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zhonglj
 * @since 2024年11月13日 09:06:21
 */
public interface ActAddSignMapper extends BaseMapper<ActAddSignEntity> {
    /**
     * 工作流启动使用
     *
     * @param
     * @return java.util.List<com.wsoft.bpm.entity.ActAddSignEntity>
     * @author zhonglj
     * @date 2024-11-13 10:36
     **/
    @Select("select * from act_add_sign where deleted = 0")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "processDefinitionId", column = "process_definition_id"),
            @Result(property = "processInstanceId", column = "process_instance_id"),
            @Result(property = "activityId", column = "activity_id"),
            @Result(property = "propertiesText", column = "properties_text")
    })
    List<ActAddSignEntity> activityFind();

    /**
     * 工作流启动使用
     *
     * @param addSign
     * @return int
     * @author zhonglj
     * @date 2024-11-13 10:35
     **/
    @Insert("insert into act_add_sign(process_definition_id, process_instance_id, activity_id, properties_text, create_by, create_time, deleted) values(#{processDefinitionId}, #{processInstanceId}, #{activityId}, #{propertiesText}, #{createBy}, now(), 0)")
    int activityInsert(ActAddSignEntity addSign);
}
